package com.harassment.interception.data.databases.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.harassment.interception.data.databases.entities.InterceptedPhone;

import java.util.List;

@Dao
public interface InterceptedPhoneDao {
    @Insert
    void addInterceptedPhone(InterceptedPhone... interceptedPhones);

    @Delete
    void deleteInterceptedPhone(InterceptedPhone... interceptedPhones);

    @Update
    void updateInterceptedPhone(InterceptedPhone... interceptedPhones);

    @Query("select * from intercepted_phone order by id desc")
    List<InterceptedPhone> getAllInterceptedPhone();

    @Query("select * from intercepted_phone where number = :number")
    InterceptedPhone getInterceptedPhoneForNumber(String number);
}
